import java.util.*;
public class teststring {
    public static void main(String[] args) {
        String data="this is a string";
        StringTokenizer st= new StringTokenizer(data);
        int count=st.countTokens();
        System.out.println("原串是 "+data);
        while(st.hasMoreTokens()){
            String s=st.nextToken();
            System.out.println(s);
        }
        System.out.println("共有 "+count+" 个单词");
        }
}
